<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

namespace builder\bundle;

use yii\bootstrap4\BootstrapAsset;
use yii\web\JqueryAsset;

/**
 * spinner 2
 * @author cleverstone
 * @since ym2.0
 */
class Spinner2 extends BaseAsset
{
    /**
     * - default 默认
     * - grow    由小变大
     * - border  缺圆旋转
     * - dot    四点旋转(大厂通用)
     */
    const SKIN = 'dot';

    /**
     * @var array
     */
    public $depends = [
        JqueryAsset::class,
    ];

    /**
     * INIT
     */
    public function init()
    {
        parent::init();
        switch (self::SKIN) {
            case 'border'://border类型
                $this->css[] = 'spinner2/spinner.border.min.css';
                $this->js[] = 'spinner2/spinner.border.min.js';
                $this->depends[] = BootstrapAsset::class;
                break;

            case 'grow'://grow类型
                $this->css[] = 'spinner2/spinner.grow.min.css';
                $this->js[] = 'spinner2/spinner.grow.min.js';
                $this->depends[] = BootstrapAsset::class;
                break;

            case 'dot'://dot类型
                $this->css[] = 'spinner2/spinner.dot.min.css';
                $this->js[] = 'spinner2/spinner.dot.min.js';
                break;

            default://默认类型
                $this->css[] = 'spinner2/spinner.min.css';
                $this->js[] = 'spinner2/spinner.min.js';
        }
    }
}